#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    vector<int> getRow(int rowIndex)
    {
        if (rowIndex == 0) return { 1 };
        if (rowIndex == 1) return { 1,1 };
        vector<vector<int>> vv;
        vector<int> v1 = { 1 };
        vector<int> v2 = { 1,1 };

        vv.push_back(v1);
        vv.push_back(v2);


        for (int i = 2; i <= rowIndex; i++)
        {
            vector<int> tmp;
            for (int j = 0; j <= i; j++)
            {
                if (j == 0 || j == i) tmp.push_back(1);
                else
                {
                    tmp.push_back(vv[i - 1][j - 1] + vv[i - 1][j]);
                }
            }
            vv.push_back(tmp);
        }
        return vv[rowIndex];


    }
};
